/*
 * Copyright 2012 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package com.lk.service;

import java.util.Map;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

class DBProxyInitializer extends ChannelInitializer<SocketChannel> {

    private final int proxyPort;
    private final String remoteHost;
    private final int remotePort;
    private final String remoteEncoder;
    private final String remoteType;
    private String responseMsg;
    private Map<String, Object> parm;


    public DBProxyInitializer(int proxyPort, String remoteHost, int remotePort, String remoteEncoder, String remoteType, String responseMsg, Map<String, Object> parm) {
        this.proxyPort = proxyPort;
        this.remoteHost = remoteHost;
        this.remotePort = remotePort;
        this.remoteEncoder = remoteEncoder;
        this.remoteType = remoteType;
        this.responseMsg = responseMsg;
        this.parm = parm;
    }

    @Override
    public void initChannel(SocketChannel ch) {

//  ch.pipeline().addLast(new DBProxyFrontendHandler(proxyPort, remoteHost, remotePort, remoteType, responseMsg, parm));
//  ch.pipeline().addLast(new StringEncoder(Charset.forName(remoteEncoder)));
//  ch.pipeline().addLast(new StringDecoder(Charset.forName(remoteEncoder)));

    }
}
